/*
package Test5;

    public class Matrix {
        double[][] matrix;
        public Matrix(double[][] matrix) throws IllegalArgumentException{
            if (matrix == null ){
                throw new IllegalArgumentException("ILLEGAL MATRIX");
            }
            this.matrix = matrix;
        }
        public Matrix() throws IllegalArgumentException {
            this(new double[0][0]);
        }
        public Matrix(int rows, int cols) throws IllegalArgumentException {
            if (rows < 0 || cols < 0) {
                throw new IllegalArgumentException("Rows & cols cannot less than 0");
            }
            this.matrix = new double[rows][cols];
        }

        public double getData(int row, int col) throws IllegalIndexException {
            if (row >= matrix.length || col >= matrix[0].length) {
                throw new IllegalIndexException(getRow(),getCol());
            }
            return matrix[row][col];
        }
        public void setData(int row, int col, double value) throws IllegalIndexException {
            if (row > matrix.length || col > matrix[0].length) {
                throw new IllegalIndexException(getRow(),getCol());
            }
            matrix[row][col] = value;
        }
        public int getRow(){
            return matrix.length;
        }
        public int getCol(){
            return matrix[0].length;
        }
        @Override
        public String toString() {
            StringBuilder s = new StringBuilder();
            for (double[] doubles : matrix) {
                s.append("{");
                for (double aDouble : doubles) {
                    s.append(aDouble).append(" ");
                }
                s.append("}"+"\n");
            }
            return s.toString();
        }
        @Override
        public boolean equals(Object obj) {
            if (obj instanceof Matrix) {
                Matrix mar=(Matrix) obj;
                if()
                    return false;
                for (int i = 0; i < matrix.length; i++) {
                    for (int j = 0; j < matrix[i].length; j++) {
                        if (matrix[i][j] != mar.matrix[i][j]) {
                            return false;
                        }
                    }
                }
                return true;
            }else
                return false;
        }
        public Matrix multiply(Matrix matrix) throws MatrixMultiplicationException, IllegalArgumentException{
            //System.out.println(getCol()+" "+ matrix.getRow());
            if (matrix==null || getCol() != matrix.getRow()) {
                throw new MatrixMultiplicationException();
            }
            double[][] result = new double[getRow()][matrix.getCol()];
            for (int i = 0; i < getRow(); i++) {
                for (int j = 0; j < matrix.getCol(); j++) {
                    for (int k = 0; k < getCol(); k++) {

                            result[i][j] += data[i][ k] * matrix.data[k][j];

                    }
                    }
                }
            }
            return new Matrix(result);
        }

    }


*/
